{include file="public/header" /}
{php}
	$role_category = model('AdminRole')->is_acl('Category/index?module=article_' . $module);
	$role_status   = model('AdminRole')->is_acl('checkbox?module=' . $module . '&field_name=status');
{/php}
<ul class="tab-label">
	<li class="on">{$_cur_title}</li>
	<li class="jump" url="{:url('recycle', array('module' => $module))}">回收站</li>
</ul>

<form method="get" action="{:url('index', array('module' => $module))}" novalidate="true">
	<section class="panel panel-default search-from">
		<header class="panel-header">
			<div class="title"><i class="icon-arrow-down-solid"></i>查询条件</div>
			<div class="opt-box" style="float: right">
				<a href="{:url('add')}" class="jump"><i class="icon-plus"></i>添加</a>
			</div>
		</header>
		<div class="panel-body">
			<div class="col-2 col-xd">
				<div class="form-group">
					<input type="text" name="title" value="{$title}" placeholder="标题">
				</div>
			</div>
			<div class="col-2 col-xd" {$role_category}>
				<div class="form-group">
					{:widget('Widget/category_select', ['类别', 'category_id', $category_id, 'article_' . $module, '', 0, 0])}
				</div>
			</div>
			<div class="col-2 col-xd">
				<div class="form-group">
					<select name="status">
						<option value="">状态</option>
						<option value="1" {eq name="status" value="1"}selected{/eq}>启用</option>
						<option value="0" {eq name="status" value="0"}selected{/eq}>禁用</option>
					</select>
				</div>
			</div>
			<div class="form-group-submit">
				<button type="submit" class="btn btn-info"><i class="icon-search"></i>查询</button>
			</div>
		</div>
	</section>
</form>

<table class="data-list">
	<tbody>
		<tr>
			<th width="40"><input type="checkbox" onclick="$.checkbox(this,'.select-box')"></th>
			<th>文章ID</th>
			<th {$role_category}>类别</th>
			<th>标题</th>
			<th width="55">排序</th>
			<th>创建时间</th>
			<th width="50" {$role_status}>启用</th>
			<th>操作</th>
		</tr>
		{volist name="list" id="rs"}
			<tr class="data-{$rs['article_id']}">
				<td class="select-box">
					<input type="checkbox" name="ids[]" value="{$rs[$pk_key]}">
				</td>
				<td><input type="hidden" name="id_arr[]" value="{$rs['article_id']}">{$rs['article_id']}</td>
				<td {$role_category}>{$rs['category_name']}</td>
				<td>{$rs['title']}</td>
				<td>
					<input class="ta-c" type="text" name="order_id[{$rs['article_id']}]" value="{$rs['order_id'] == 99 ? '' : $rs['order_id']}">
				</td>
				<td>{:date('Y-m-d H:i:s', $rs['create_time'])}</td>
				<td {$role_status}>
					<input class="ajax_checkbox" url="{:url('checkbox', array('module' => $module, 'field_name' => 'status', 'pk_val' => $rs['article_id'],'pk_key'=>'article_id'))}" type="checkbox" value="1" {$rs['status'] ? 'checked' : ''}>
				</td>
				<td>
					<a href="{:url('edit', array('module' => $module, 'article_id' => $rs['article_id']))}" class="btn btn-default">
						<i class="icon-edit"></i>
					</a>
					<a class="btn btn-default confirm-opt" href="{:url('del', array('module' => $module, 'article_id' => $rs['article_id']))}" title="删除" msg="您确认要删除此文章？" del-class="data-{$rs['article_id']}">
						<i class="icon-delete"></i>
					</a>
				</td>
			</tr>
		{/volist}
		
	</tbody>
</table>
<div class="opt-page-box">
	<ul class="button-group">
		<li class="btn bg-default jump" url="{:url('add', array('module' => $module))}"><i class="icon-plus"></i>添加</li>
		<li class="btn bg-default batch-opt" url="{:url('del', array('module' => $module))}"><i class="icon-delete"></i>删除</li>
		<li class="btn bg-default batch-edit" url="{:url('index', array('module' => $module))}"><i class="icon-sort"></i>排序</li>
	</ul>
	{$page}
</div>

{include file="public/footer" /}